home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / BoxKite.dxr / Internal_65_foundation cards.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  1.8 KB  |  50 lines

  1. property spriteNum
  2. global foundation, stock, equal, hotcard, win, pootimer
  3.  
  4. on beginSprite
  5.   foundation.addProp(makesymbol(spriteNum), new(script("foundation object"), []))
  6.   foundation[makesymbol(spriteNum)].addCard(new(script("card"), spriteNum))
  7. end
  8.  
  9. on mouseDown
  10.   if foundation[makesymbol(spriteNum)].cards.count > 1 then
  11.     sprite(spriteNum).moveableSprite = 1
  12.     sprite(spriteNum).loc = the mouseLoc
  13.     sprite(spriteNum).locZ = spriteNum + 1000
  14.     sprite(17).loc = foundation[makesymbol(spriteNum)].getlastcard().location
  15.     sprite(17).visible = 1
  16.     sprite(17).member = foundation[makesymbol(spriteNum)].cards[foundation[makesymbol(spriteNum)].cards.count - 1].membername
  17.   end if
  18. end
  19.  
  20. on mouseUp
  21.   if foundation[makesymbol(spriteNum)].cards.count > 1 then
  22.     if equal = 1 then
  23.       puppetSound(3, "pickcard")
  24.       sprite(spriteNum).visible = 0
  25.       sprite(spriteNum).moveableSprite = 0
  26.       sprite(spriteNum).locZ = spriteNum
  27.       sprite(spriteNum).loc = foundation[makesymbol(spriteNum)].getlastcard().location
  28.       sprite(hotcard).member = sprite(spriteNum).member
  29.       foundation[makesymbol(spriteNum)].cards.deleteAt(foundation[makesymbol(spriteNum)].cards.count)
  30.       sprite(spriteNum).member = foundation[makesymbol(spriteNum)].getlastcard().membername
  31.       getlist(hotcard).add(new(script("card"), hotcard))
  32.       sprite(spriteNum).visible = 1
  33.       if (hotcard >= 34) and (hotcard <= 45) then
  34.         points = points - 10
  35.       end if
  36.     else
  37.       puppetSound(3, "dropcard")
  38.       sprite(spriteNum).moveableSprite = 0
  39.       sprite(spriteNum).locZ = spriteNum
  40.       sprite(spriteNum).loc = foundation[makesymbol(spriteNum)].getlastcard().location
  41.     end if
  42.     if points = (96 * 10) then
  43.       win = "yes"
  44.       pootimer = timeout("po").new(150, #gotoit)
  45.     else
  46.       checklose()
  47.     end if
  48.   end if
  49. end
  50.